//
//  Product.m
//  LiWuShuo
//
//  Created by 袁小航 on 14/11/13.
//  Copyright (c) 2014年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "Product.h"
#import "Define.h"

@implementation Product

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
//        创建productCollectionView
        [self createProductCollectionView];
    }
    return self;
}

#pragma mark -
#pragma mark 创建productCollectionView
- (void)createProductCollectionView
{
    self.proLayout = [[UICollectionViewFlowLayout alloc]init];
    self.proLayout.itemSize = CGSizeMake(PRO_IMAGE_WIDTH - 14, ((PRO_IMAGE_HEIGHT - 40) / 3));
    _proLayout.sectionInset = UIEdgeInsetsMake(7, 0, 10, 0);
    
    self.proCollectionView = [[UICollectionView alloc]initWithFrame:self.bounds collectionViewLayout:self.proLayout];
    self.proCollectionView.backgroundColor = [UIColor whiteColor];
    [self addSubview:_proCollectionView];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
